home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / THINKC / 4_0 / FIX_DESK / SOURCE / MFS.C < prev    next >
C/C++ Source or Header  |  1988-09-07  |  1KB  |  62 lines

  1. #include <MacTypes.h>
  2. #include <FileMgr.h>
  3.  
  4. #include "fix.h"
  5.  
  6. void mfs_comment_processing(ParmBlkPtr pb, int is_vol);
  7. void mfs_bundle_processing(ParmBlkPtr pb, int is_vol);
  8.  
  9.     /* Disk scanning control for an MFS volume. */
  10.  
  11. void mfs_scan_disk()
  12. {
  13.     register int index, done, result;
  14.     ParamBlockRec pb;
  15.     unsigned char name[LONG_NAME_SIZE];
  16.  
  17.     pb.volumeParam.ioCompletion = NIL;
  18.     pb.volumeParam.ioNamePtr = name;
  19.     pb.volumeParam.ioVRefNum = volume_refnum;
  20.  
  21.     pb.volumeParam.ioVolIndex = 0;
  22.     PBGetVInfo(&pb, 0);
  23.     if (process_comments)
  24.         mfs_comment_processing(&pb, 1);
  25.     if (process_bundles)
  26.         mfs_bundle_processing(&pb, 1);
  27.  
  28.     index = 1; done = 0;
  29.     while (!done) {
  30.         SystemTask();
  31.         pb.fileParam.ioFDirIndex = index++;
  32.         result = PBGetFInfo(&pb, 0);
  33.         if ((result != noErr) || (pb.fileParam.ioResult != noErr))
  34.             done = 1;
  35.         else {
  36.             if (process_comments)
  37.                 mfs_comment_processing(&pb, 0);
  38.             if (process_bundles)
  39.                 mfs_bundle_processing(&pb, 0);
  40.         }
  41.     }
  42. }
  43.  
  44.     /* Do comment processing for a file under MFS. */
  45.  
  46. static void mfs_comment_processing(pb, is_vol)
  47.     ParmBlkPtr pb;
  48.     int is_vol;
  49. {
  50.     remove_fcmt(comment_hash(pb->fileParam.ioNamePtr));
  51. }
  52.  
  53.     /* Do bundle processing for a file under MFS. */
  54.  
  55. static void mfs_bundle_processing(pb, is_vol)
  56.     ParmBlkPtr pb;
  57.     int is_vol;
  58. {
  59.     if (!is_vol)
  60.         remove_bndl(pb->fileParam.ioFlFndrInfo.fdCreator);
  61. }
  62.